#ifndef __ADU_GAME_PLAY_SCENE_H__
#define __ADU_GAME_PLAY_SCENE_H__

#include "cocos2d.h"
#include "ADUConstant.h"
#include "ADUWater.h"
#include "ADUPipe.h"
#include "ADUConfig.h"
#include "ADUBasin.h"
#include "ADUDuck.h"
#include "GLES-Render.h"
#include <Box2D/Box2D.h>

class Flow;
class Basin;
class Duck;
USING_NS_CC;
using namespace std;

class GamePlayLayer : public cocos2d::Layer
{
public:
    static cocos2d::Scene* createScene();
    virtual bool init();  
    void update(float dt);
	void OnExitClicked();
	void OnPauseClicked();
	void OnSoundClicked();
	void OnMusicClicked();
    CREATE_FUNC(GamePlayLayer);

	
	virtual bool 		onTouchBegan(cocos2d::Touch *touch, cocos2d::Event *event);
	virtual void 		onTouchMoved(cocos2d::Touch *touch, cocos2d::Event *event);
	virtual void 		onTouchEnded(cocos2d::Touch *touch, cocos2d::Event *event);
	virtual void 		onTouchCancelled(cocos2d::Touch *touch, cocos2d::Event *event);

	virtual void draw(Renderer *renderer, const Mat4& transform, uint32_t flags);


private:
	EventListenerTouchOneByOne* mTouchListener;
	Sprite* 					mBackground;
    Water* 						mWater;
	Pipe*						mPipe;
	float 						mt;
	Duck* 						mDuck;
	Sprite* 					mExitSprite;
	Sprite* 					mPauseSprite;
	Sprite* 					mSoundSprite;
	Sprite* 					mMusicSprite;
	Flow*						mFlow;
	b2World* 					mWorld;
	bool						mAllowFlow;
};

#endif // __HELLOWORLD_SCENE_H__
